using ConstructorAsyncWebApi.Services;
using Microsoft.AspNetCore.Mvc;

namespace ConstructorAsyncWebApi.Controllers
{
    [ApiController]
    [Route("[controller]")]
    public class WeatherForecastController : ControllerBase
    {
        private readonly ILogger<WeatherForecastController> _logger;
        private readonly IDataGenerationService _dataGenerationService;
        private readonly IDataSegmentationService _dataSegmentationService;
        private readonly IDataCompareService _dataCompareService;
        public WeatherForecastController(
            ILogger<WeatherForecastController> logger,
            IDataGenerationService dataGenerationService,
            IDataSegmentationService dataSegmentationService,
            IDataCompareService dataCompareService)
        {
            _logger = logger;
            _dataGenerationService = dataGenerationService;
            _dataSegmentationService = dataSegmentationService;
            _dataCompareService = dataCompareService;
        }

        [HttpGet]
        public async Task<IActionResult> Get()
        {
            var results = await _dataGenerationService.Generate();
            return Ok(results);
        }

        [HttpGet("Summarys")]
        public async Task<IActionResult> GetSummarys()
        {
            var results = await _dataSegmentationService.SegmentationSummarys();
            return Ok(results);
        }

        [HttpGet("Ids")]
        public async Task<IActionResult> GetIds()
        {
            var results = await _dataSegmentationService.SegmentationIds();
            return Ok(results);
        }

        [HttpGet("IsInSame")]
        public async Task<IActionResult> GetIsInSame()
        {
            var results = await _dataCompareService.GetIsInSame();
            return Ok(results);
        }
    }
}
